import { FC } from "react"

import { SFormItem } from "@/components/common"
import StyleSelect from "@/components/common/styleSelect"
import { useOptions } from "@/hooks"
import { useLocale } from "@/locales"
// import { TableColumnType } from "antd"
// import dynamicComponent from "./dynamicImport"

const PayoutSelect: FC<{ options?: string[]; fieldName?: string; label?: string; placeholder?: string }> = props => {
	const { newFormat } = useLocale()
	const { fieldName, label, placeholder } = props
	const options = useOptions({ modal: "proxyPayoutStatus", func: newFormat }).filter((item: { value: string }) =>
		props.options ? props.options.includes(item.value) : true
	)

	return (
		<SFormItem name={fieldName ?? "payoutStatus"} label={label ?? newFormat("label.terminalStatus")}>
			<StyleSelect options={options} placeholder={placeholder ?? newFormat({ id: "label.select_all" })} allowClear />
		</SFormItem>
	)
}

export default PayoutSelect
